home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12625 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  918 b 

  1. Path: aadt.sdt.com!usenet
  2. From: david_hooker@sdt.com
  3. Newsgroups: comp.lang.c++
  4. Subject: Advanced C++ question...
  5. Date: 20 Mar 1996 20:57:20 GMT
  6. Organization: SABRE Decision Technologies
  7. Message-ID: <4iprfg$1ui@aadt>
  8. Reply-To: david_hooker@sdt.com
  9. NNTP-Posting-Host: 144.9.150.154
  10. X-Newsreader: IBM NewsReader/2 v1.02
  11.  
  12. Hi all...
  13.  
  14. I want to write an operator* for a class, but I want to do
  15. one of 2 things:
  16.    1. Call one of two different operator*'s depending on whether
  17.       it is an lvalue or rvalue
  18.    OR
  19.    2. Somehow determine in the function if it is being used as an
  20.       lvalue or an rvalue.
  21.  
  22. For instance, I want to know, in the operator*, from which case I'm
  23. being called:
  24.  
  25.   *Object = SomeValue;     // used as an lvalue
  26.  
  27.    SomeValue = *Object;    // used as an rvalue
  28.  
  29.  
  30. The reason for this is that this class accesses data differently depending
  31. on if it is a read or write access.
  32.  
  33. Thanks...
  34.  
  35. -dave-
  36.  
  37.  
  38.  
  39.  
  40.